<c:if test="true"
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:c="http://java.sun.com/jstl/core"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:nxl="http://nuxeo.org/nxforms/layout"
  xmlns:nxu="http://nuxeo.org/nxweb/util"
  xmlns:a4j="http://richfaces.org/a4j">

  <a4j:region renderRegionOnly="true">
    <a4j:outputPanel layout="block" id="#{widget.id}_panel">
      <table class="listShuttleTable">
        <tbody>
          <tr>
            <th>
              <c:if test="#{not empty widgetProperty_availableElementsLabel}">
                <h:outputText value="#{messages[widgetProperty_availableElementsLabel]}" />
              </c:if>
            </th>
            <th>
            </th>
            <th>
              <c:if test="#{not empty widgetProperty_selectedElementsLabel}">
                <h:outputText value="#{messages[widgetProperty_selectedElementsLabel]}" />
              </c:if>
            </th>
            <c:if test="#{widgetProperty_showOrderingActions}">
              <th></th>
            </c:if>
          </tr>
          <tr>
            <td class="listShuttleSelectElements">
              <h:selectManyListbox id="#{widget.id}_sourceSelect"
                size="#{nxu:test(empty widgetProperty_selectSize, 5, widgetProperty_selectSize)}"
                class="listShuttleSelect">
                <nxu:selectItems
                  value="#{widgetProperty_sourceItems}"
                  var="#{widgetProperty_sourceItemVar}"
                  itemValue="#{widgetProperty_sourceItemValue}"
                  itemLabel="#{widgetProperty_sourceItemLabel}"
                  itemDisabled="#{widgetProperty_sourceItemDisabled}"
                  ordering="#{widgetProperty_sourceItemOrdering}"
                  caseSensitive="#{widgetProperty_sourceItemCaseSensitive}"
                  id="#{widget.id}_sourceItems" />
              </h:selectManyListbox>
              <h:message styleClass="errorMessage" for="#{widget.id}_sourceSelect"/>
            </td>
            <td class="listShuttleSelectionActions">
              <a4j:commandLink bypassUpdates="true"
                actionListener="#{selectionActions.removeFromSelection}"
                id="#{widget.id}_removeFormSelection"
                render="#{widget.id}_panel"
                ignoreDupResponses="true">
                <f:param name="leftSelect" value="#{widget.id}_sourceSelect"/>
                <f:param name="leftItems" value="#{widget.id}_sourceItems"/>
                <f:param name="rightSelect" value="#{widget.id}_targetSelect"/>
                <f:param name="rightItems" value="#{widget.id}_targetItems"/>
                <f:param name="submittedList" value="#{widget.id}_hiddenTargetList"/>
                <nxu:graphicImage value="/icons/move_left.png"
                  alt="#{messages['command.selection.remove']}"
                  title="#{messages['command.selection.remove']}"/>
              </a4j:commandLink>
              <a4j:commandLink bypassUpdates="true"
                actionListener="#{selectionActions.addToSelection}"
                id="#{widget.id}_addToSelection"
                render="#{widget.id}_panel"
                ignoreDupResponses="true">
                <f:param name="leftSelect" value="#{widget.id}_sourceSelect"/>
                <f:param name="leftItems" value="#{widget.id}_sourceItems"/>
                <f:param name="rightSelect" value="#{widget.id}_targetSelect"/>
                <f:param name="rightItems" value="#{widget.id}_targetItems"/>
                <f:param name="submittedList" value="#{widget.id}_hiddenTargetList"/>
                <nxu:graphicImage value="/icons/move_right.png"
                  alt="#{messages['command.selection.add']}"
                  title="#{messages['command.selection.add']}"/>
              </a4j:commandLink>
              <a4j:commandLink bypassUpdates="true"
                actionListener="#{selectionActions.addAllToSelection}"
                id="#{widget.id}_addAllToSelection"
                render="#{widget.id}_panel"
                ignoreDupResponses="true">
                <f:param name="leftSelect" value="#{widget.id}_sourceSelect"/>
                <f:param name="leftItems" value="#{widget.id}_sourceItems"/>
                <f:param name="rightSelect" value="#{widget.id}_targetSelect"/>
                <f:param name="rightItems" value="#{widget.id}_targetItems"/>
                <f:param name="submittedList" value="#{widget.id}_hiddenTargetList"/>
                <nxu:graphicImage value="/icons/move_all_right.png"
                  alt="#{messages['command.selection.addAll']}"
                  title="#{messages['command.selection.addAll']}"/>
              </a4j:commandLink>
              <a4j:commandLink bypassUpdates="true"
                actionListener="#{selectionActions.removeAllFromSelection}"
                id="#{widget.id}_removeAllFromSelection"
                render="#{widget.id}_panel"
                ignoreDupResponses="true">
                <f:param name="leftSelect" value="#{widget.id}_sourceSelect"/>
                <f:param name="leftItems" value="#{widget.id}_sourceItems"/>
                <f:param name="rightSelect" value="#{widget.id}_targetSelect"/>
                <f:param name="rightItems" value="#{widget.id}_targetItems"/>
                <f:param name="submittedList" value="#{widget.id}_hiddenTargetList"/>
                <nxu:graphicImage value="/icons/move_all_left.png"
                  alt="#{messages['command.selection.removeAll']}"
                  title="#{messages['command.selection.removeAll']}"/>
              </a4j:commandLink>
            </td>
            <td class="listShuttleSelectElements">
              <div>
                <h:outputText value="#{messages[widgetProperty_selectedElementsHelp]}" />
              </div>
              <h:selectManyListbox id="#{widget.id}_targetSelect"
                size="#{nxu:test(empty widgetProperty_selectSize, 5, widgetProperty_selectSize)}"
                class="listShuttleSelect">
                <nxu:selectItems
                  value="#{widgetProperty_targetItems}"
                  var="#{widgetProperty_targetItemVar}"
                  itemValue="#{widgetProperty_targetItemValue}"
                  itemLabel="#{widgetProperty_targetItemLabel}"
                  itemDisabled="#{widgetProperty_targetItemDisabled}"
                  ordering="#{widgetProperty_targetItemOrdering}"
                  caseSensitive="#{widgetProperty_targetItemCaseSensitive}"
                  id="#{widget.id}_targetItems" />
              </h:selectManyListbox>
              <h:message styleClass="errorMessage"
                for="#{widget.id}_targetSelect"/>
              <c:choose>
                <c:when test="#{widget.properties.containsKey('defaultValue')}">
                  <nxu:inputList id="#{widget.id}_hiddenTargetList"
                    model="model" diff="false" value="#{fieldOrValue}"
                    defaultValue="#{widgetProperty_defaultValue}"
                    required="#{widgetProperty_required}" />
                </c:when>
                <c:otherwise>
                  <nxu:inputList id="#{widget.id}_hiddenTargetList"
                    model="model" diff="false" value="#{fieldOrValue}"
                    required="#{widgetProperty_required}" />
                </c:otherwise>
              </c:choose>
              <h:message styleClass="errorMessage" for="#{widget.id}_hiddenTargetList"/>
            </td>
            <c:if test="#{widgetProperty_showOrderingActions}">
              <td class="listShuttleSelectionActions">
                <a4j:commandLink bypassUpdates="true"
                  actionListener="#{selectionActions.shiftSelectedFirst}"
                  id="#{widget.id}_shiftSelectedFirst"
                  render="#{widget.id}_panel"
                  ignoreDupResponses="true">
                  <f:param name="rightSelect" value="#{widget.id}_targetSelect"/>
                  <f:param name="rightItems" value="#{widget.id}_targetItems"/>
                  <f:param name="submittedList" value="#{widget.id}_hiddenTargetList"/>
                  <nxu:graphicImage value="/icons/move_top.png"
                    alt="#{messages['command.selection.moveToTop']}"
                    title="#{messages['command.selection.moveToTop']}"/>
                </a4j:commandLink>
                <a4j:commandLink bypassUpdates="true"
                  actionListener="#{selectionActions.shiftSelectedUp}"
                  id="#{widget.id}_shiftSelectedUp"
                  render="#{widget.id}_panel"
                  ignoreDupResponses="true">
                  <f:param name="rightSelect" value="#{widget.id}_targetSelect"/>
                  <f:param name="rightItems" value="#{widget.id}_targetItems"/>
                  <f:param name="submittedList" value="#{widget.id}_hiddenTargetList"/>
                  <nxu:graphicImage value="/icons/move_up.png"
                    alt="#{messages['command.selection.moveUp']}"
                    title="#{messages['command.selection.moveUp']}"/>
                </a4j:commandLink>
                <a4j:commandLink bypassUpdates="true"
                  actionListener="#{selectionActions.shiftSelectedDown}"
                  id="#{widget.id}_shiftSelectedDown"
                  render="#{widget.id}_panel"
                  ignoreDupResponses="true">
                  <f:param name="rightSelect" value="#{widget.id}_targetSelect"/>
                  <f:param name="rightItems" value="#{widget.id}_targetItems"/>
                  <f:param name="submittedList" value="#{widget.id}_hiddenTargetList"/>
                  <nxu:graphicImage value="/icons/move_down.png"
                    alt="#{messages['command.selection.moveDown']}"
                    title="#{messages['command.selection.moveDown']}"/>
                </a4j:commandLink>
                <a4j:commandLink bypassUpdates="true"
                  actionListener="#{selectionActions.shiftSelectedLast}"
                  id="#{widget.id}_shiftSelectedLast"
                  render="#{widget.id}_panel"
                  ignoreDupResponses="true">
                  <f:param name="rightSelect" value="#{widget.id}_targetSelect"/>
                  <f:param name="rightItems" value="#{widget.id}_targetItems"/>
                  <f:param name="submittedList" value="#{widget.id}_hiddenTargetList"/>
                  <nxu:graphicImage value="/icons/move_end.png"
                    alt="#{messages['command.selection.moveToBottom']}"
                    title="#{messages['command.selection.moveToBottom']}"/>
                </a4j:commandLink>
              </td>
            </c:if>
          </tr>
        </tbody>
      </table>
    </a4j:outputPanel>
  </a4j:region>

</c:if>